package sg.edu.nus.iss.phoenix.users.dao;
import java.sql.SQLException;

import sg.edu.nus.iss.phoenix.authenticate.entity.Role;
import sg.edu.nus.iss.phoenix.authenticate.entity.User;

/**
 * @author Puwanendran Nishanthan
 *
 */
public interface UserRoleDAO {
	/**
	 * This method grants access rights privileges to a {@link User} based on assigned {@link Role}.  
	 * The {@link User} that granted the rights is recorded.
	 * 
	 * @param user
	 *            This parameter contains user to be granted rights.
	 * @param role
	 *            This parameter contains the role to be granted.
	 * @param currentUser
	 *            This parameter contains the user that granted the rights.
	 * @throws SQLException
	 */
	public void grantAccess(User user, Role role, User currentUser) throws SQLException;
	
	/**
	 * This method revokes access rights privileges from a {@link User} based on {@link Role} removed.
	 * 
	 * @param user
	 *            This parameter contains user to have rights revoked.
	 * @param role
	 *            This parameter contains the role to be removed.
	 * @throws SQLException
	 */
	public void revokeAccess(User user, Role role) throws SQLException;
}



